﻿@model SCMS.UI.Models.TenderAnalysis
<b>Tender Suppliers</b>&nbsp
@Ajax.ActionLink("New supplier", "Index", new { id = "LoadAddSuplier/" + ViewBag.TAID }, new AjaxOptions
{
    UpdateTargetId = "popupDiv",
    LoadingElementId = "loading",
    Url = Url.Action("LoadAddSuplier/" + ViewBag.TAID),
    OnSuccess = "ShowPopupDiv"
})

<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
@if (Model.HasSuppliers)
{
<table width="100%" align="center" cellspacing="0" cellpadding="5" border="1" style="border: 1px solid grey;
        border-collapse: collapse; padding: 5px; font-size: 12px;">
        <tr class="gridheader">
            <th>
                Description
            </th>
            @foreach (var item in Model.SupplierName)
            {
                <th>
                    @Html.DisplayFor(modelItem => item)
                </th>
            }
        </tr>
        @{int x = 0; int cols = 1 + Model.SupplierName.Count; string rowClass = ""; }
        @foreach (var item in Model.TBiderQuotes)
        {
            if (x % 2 == 0) { rowClass = "grideven"; }
            if (x % 2 != 0) { rowClass = "gridodd"; }
            if (x >= 0) { x = x + 1; }
            <tr class="grideven">
                <td>
                    @Html.DisplayFor(modelItem => item.ItemDescription)
                </td>
                @foreach (var subItem in item.UnitCost)
                { 
                    <td align="right">
                        @Html.DisplayFor(subModelItem => subItem)
                    </td>
                }
            </tr>
        }
        <tr>
            <td>Transport Cost</td>
             @foreach (var item in Model.TransportCost)
             {
                <td align="right">@Html.DisplayFor(modelItem => item)</td>
             }
        </tr>
        <tr>
            <td>Total Cost</td>
             @foreach (var item in Model.TotalCost)
             {
                <td align="right">@Html.DisplayFor(modelItem => item)</td>
             }
        </tr>
        <tr class="gridheader"><td align="center" colspan=@cols>Terms and Conditions</td></tr>
        <tr>
            <td>Shipping Term</td>
            @foreach (var item in Model.ShippingTerm)
            {
                <td>@Html.DisplayFor(modelItem => item)</td>
            }
        </tr>
        <tr>
            <td>Delivery Time</td>
            @foreach (var item in Model.DeliveryTime)
            {
                <td>@Html.DisplayFor(modelItem => item)</td>
            }
        </tr>
        <tr>
            <td>Warranty</td>
            @foreach (var item in Model.Warrant)
            {
                <td>@Html.DisplayFor(modelItem => item)</td>
            }
        </tr>
        <tr>
            <td>Terms of Payment</td>
            @foreach (var item in Model.TermzOfPayment)
            {
                <td>@Html.DisplayFor(modelItem => item)</td>
            }
        </tr>
        <tr>
            <td>Other</td>
            @foreach (var item in Model.others)
            {
                <td>@Html.DisplayFor(modelItem => item)</td>
            }
        </tr>
    </table>
}
